import 'package:flutter/material.dart';

/// 简单的scrollbar示例
class SampleScrollbarWidget extends StatefulWidget {
  const SampleScrollbarWidget({Key? key}) : super(key: key);

  @override
  _SampleScrollbarWidgetState createState() => _SampleScrollbarWidgetState();
}

class _SampleScrollbarWidgetState extends State<SampleScrollbarWidget> {

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
      child: Scrollbar(
          child: ListView.builder(
            itemBuilder: (context, index) {
              return Card(
                child: Container(
                  alignment: Alignment.center,
                  child: Text("$index"),
                ),
              );
            },
            itemCount: 30,
            itemExtent: 85,
          )),
    );
  }
}
